package com.qingke.pms.command.project;

import com.qingke.pms.command.ProjectCommand;
import com.qingke.pms.pojo.Project;
import com.qingke.pms.pojo.User;
import com.qingke.pms.util.PMSConsole;

public class AddPuchasePlanCommand extends ProjectCommand {

	public AddPuchasePlanCommand(User user, Project project) {
		super(user, project);
	}

	@Override
	public void execute() {
		if(!dao.isLeader(project, user)){
			PMSConsole.println("you are not the leader of this project.");
			return ;
		}
		String code=null;
		while(true){
			code=PMSConsole.promptNotEmpty("purchase plan code:");
			if(dao.isPurchasePlanExistByCode(code)){
				PMSConsole.println("the code has been used.");
				continue;
			}
			break;
		}
		String description=PMSConsole.promptCanEmpty("purchase plan description:");
		
		//!!!!!!!!!!!!!!!!!!!!!!!!!
	}

}
